package com.jasper.entertaining.service.impl;

import com.jasper.entertaining.entity.User;
import com.jasper.entertaining.mapper.UserMapper;
import com.jasper.entertaining.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public int register(User user) {
        int id = userMapper.insertUser(user);
        return user.getId();
    }

    @Override
    public User login(User user) {
        User user1= userMapper.selectUser(user);
        return user1;
    }

    @Override
    public User selectUserIsExist(User user) {
        User user1= userMapper.selectUserIsExist(user);
        return user1;
    }
}
